<template lang="pug">
  .step-1
    Spin(v-if="spinShow" size="large" fix)
    Form(v-if="formValidate_t1" :label-width="125")
      Row(type="flex" justify="start" :gutter="18")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem.ivu-form-item-required(label="客户名称：")
            Input(v-model="formValidate_t1.name" :placeholder="isCheck?'未填写':'请输入'" :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="客户编码：")
            Input(v-model="formValidate_t1.code" :placeholder="isCheck?'未填写':'请输入'" :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="上级公司名称：")
            Select(v-model="formValidate_t1.superCompanyId" :label-in-value="true" filterable :placeholder="isCheck?'未填写':'请选择'" clearable @on-change="superCompanyIdChange" :disabled="isCheck")
              Option(v-for="(item, index) in superCompanyId_arr" :value="item.key" :key="index") {{ item.value }}
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="合作状态：")
            Select(v-model="formValidate_t1.status"  :placeholder="isCheck?'未填写':'请选择'" :disabled="isCheck")
              Option(v-for="(item, index) in cooperateStatuseType_arr" :value="parseInt(item.key)" :key="index") {{ item.value }}
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem.ivu-form-item-required(label="合作类型：")
            Select(v-model="formValidate_t1.type" :placeholder="isCheck?'未填写':'请选择'" clearable :disabled="isCheck")
              Option(v-for="(item, index) in cooperateType_arr" :value="parseInt(item.key)" :key="index") {{ item.value }}
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="客户分类：")
            Select(v-model="formValidate_t1.category" :label-in-value="true" :placeholder="isCheck?'未填写':'请选择'" clearable @on-change="categoryChange" :disabled="isCheck")
              Option(v-for="(item, index) in customerCategory_arr" :value="item.key" :key="index") {{ item.value }}
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="公司性质：")
            Select(v-model="formValidate_t1.character" :label-in-value="true" :placeholder="isCheck?'未填写':'请选择'" clearable @on-change="characterChange" :disabled="isCheck")
              Option(v-for="(item, index) in customerCharacter_arr" :value="item.key" :key="index") {{ item.value }}
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem.ivu-form-item-required(label="人事负责人姓名：" :label-width="135")
            Input(v-model="formValidate_t1.hrContactName" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem.ivu-form-item-required(label="人事负责人电话：" :label-width="135")
            Input(v-model="formValidate_t1.hrContactPhone" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="人事负责人邮箱：")
            Input(v-model="formValidate_t1.hrContactEmail" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="关键决策人姓名：")
            Input(v-model="formValidate_t1.inChargeContacName" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="关键决策人电话：")
            Input(v-model="formValidate_t1.inChargeContacPhone" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="关键决策人职务：")
            Input(v-model="formValidate_t1.inChargeContacTitle" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="公司邮箱：")
            Input(v-model="formValidate_t1.email" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="公司电话：")
            Input(v-model="formValidate_t1.phone" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="公司网址：")
            Input(v-model="formValidate_t1.webSite" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="客户所在城市：")
            Cascader(v-model="costomerCity_arr" :filterable="true" :placeholder="isCheck?'未填写':'请输入'" :disabled="isCheck" :data="areaArr" :load-data="loadDataCity" style="width:100%;" @on-change="costomerCityChange")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="邮政编码：")
            Input(v-model="formValidate_t1.postCode" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem.ivu-form-item-required(label="所属客服：")
            Select(v-model="formValidate_t1.serverId" :placeholder="isCheck?'未填写':'请输入'" filterable :label-in-value="true" placement="top-start" @on-change="addServerIdChange" style="width:100%" :disabled="isCheck")
              Option(v-for="(item, index) in serverId_arr" :value="item.key" :key="index") {{ item.value }}
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="财务编码：")
            Input(v-model="formValidate_t1.financeCode" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="部门编码：")
            Input(v-model="formValidate_t1.deptCode" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="申报单位：")
            Select(v-model="formValidate_t1.declareUnitId" :placeholder="isCheck?'未选择':'请选择'" filterable clearable :disabled="isCheck")
              Option(v-for="(item, index) in unitList" :value="item.id" :key="index") {{ item.name }}
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="客户到款月份：" :label-width="150")
            RadioGroup(v-model="formValidate_t1.payDeadLineDayType")
              Radio(label="0" :disabled="isCheck") 当月
              Radio(label="1" :disabled="isCheck") 次月
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem.ivu-form-item-required(label="客户到款日期：")
            Select(v-model="formValidate_t1.payDeadLineDay" placeholder="请选择到款日期" filterable :disabled="isCheck")
              Option(v-for="(item, index) in days" :value="item.value" :key="index") {{ item.label }}
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="是否允许即时开票：" :label-width="150")
            i-switch.customer-switch(v-model="formValidate_t1.isForthwithInvoiceNo" :disabled="isCheck")
              span(slot="open") 是
              span(slot="close") 否
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="分类：")
            Select(v-model="formValidate_t1.categoriesID" :placeholder="isCheck?'未选择':'请选择'" multiple filterable clearable :disabled="isCheck" :label-in-value="true" @on-change="categoriesChange")
              Option(v-for="(item, index) in categoriesList" :value="item.value" :key="index") {{ item.text }}
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="开票方式：")
            Select(v-model="formValidate_t1.invoiceManner" :placeholder="isCheck?'未选择':'请选择'" filterable clearable :disabled="isCheck")
              Option(v-for="(item, index) in invoiceMannerList" :value="item.value" :key="index") {{ item.text }}
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="备注：")
            Input(v-model="formValidate_t1.remarks" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
      Divider.mt-0
      Row(type="flex" justify="start")
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="签单公司：")
            Select(v-model="formValidate_t1.signingCompanyId" :placeholder="isCheck?'未选择':'请选择'" clearable :disabled="isCheck")
              Option(v-for="(item, index) in signingCompany_arr" :value="item.value" :key="item.value") {{ item.text }}
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="所属部门：")
            Select(v-model="formValidate_t1.departmentId" :placeholder="isCheck?'未选择':'请选择'" clearable :disabled="isCheck")
              Option(v-for="(item, index) in department_arr" :value="item.value" :key="item.value") {{ item.text }}
        Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          FormItem(label="所属区域：")
            Select(v-model="formValidate_t1.regionId" :placeholder="isCheck?'未选择':'请选择'" clearable :disabled="isCheck")
              Option(v-for="(item, index) in region_arr" :value="item.value" :key="item.value") {{ item.text }}
      template(v-for="(item, index) in formValidate_t1.salesInfo")
        Row(type="flex" justify="start" :key="index")
          Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
            FormItem(label="所属销售：")
              Select(v-model="item.salesId" :placeholder="isCheck?'未选择':'请选择'" :label-in-value="true" clearable :disabled="isCheck" @on-change="salesChange")
                Option(v-for="(i, idx) in sales_arr" :value="i.value" :key="i.value" :tag="index") {{ i.text }}
          Col(:md="{ span: 24 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
            FormItem(label="销售占比：")
              .display-flex
                Input(v-model="item.ratio" type="number" :placeholder="isCheck?'未填写':'请输入'" :disabled="isCheck")
                  div(slot="suffix" style="height: 100%; line-height:2.5") %
                Button.ml-20(v-if="!isCheck" type="error" ghost @click="delSalePeople(index)") 删除
      Divider.mt-0(v-if="!isCheck")
        Button(type="info" size="small" @click="addSalePeople") 添加销售

      FormItem(label="办公地址：")
        Input(v-model="formValidate_t1.address" type="textarea" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
      FormItem(label="公司简介：")
        Input(v-model="formValidate_t1.description" type="textarea" :placeholder="isCheck?'未填写':'请输入'" clearable :disabled="isCheck")
    //- .tab-footer.clearfix
    //-   Button.pull-right(v-if="isCheck" type="info" @click="reviseBtn") 修改
    //-   Button.pull-right(v-else type="info" @click="saveStep_1") 保存
</template>

<script>
import dataApi from '@/api/data.js'
export default {
  name: 'stpe_1',
  props: {
    customerId: String
  },
  data () {
    return {
      areaArr: [],
      mustHave: false, // 必填
      spinShow: false, // 加载中
      isCheck: true, // 是否处于查看状态
      // formValidate_t1: null, // 营业执照信息
      formValidate_t1: {
        costomerCity_arr: [],
        id: '', // 客户ID,新增为空
        name: '', // 客户名称
        code: '', // 客户编码
        superCompanyId: '', // 上级公司ID
        superCompanyName: '', // 上级公司名称
        status: '1', // 合作状态
        type: '', // 合作类型
        category: '', // 客户分类ID
        categoryName: '', // 客户分类名称
        character: '', // 公司性质
        characterName: '', // 公司性质名称
        hrContactName: '', // 人事负责人姓名
        hrContactPhone: '', // 人事负责人电话
        hrContactEmail: '', // 人事负责人邮箱
        inChargeContacName: '', // 关键决策人姓名
        inChargeContacPhone: '', // 关键决策人电话
        inChargeContacTitle: '', // 关键决策人职务
        phone: '', // 电话
        email: '', // 邮箱
        webSite: '', // 网站
        postCode: '', // 邮编
        cityId: '', // 客户所在城市ID
        cityName: '', // 客户所在城市名称
        AreaPath: '',
        address: '', // 地址
        serverId: '', // 客服id
        serverName: '', // 客服名字
        deptCode: '', // 部门编码
        financeCode: '', // 财务编码
        declareUnitId: '', // 申报单位
        categoriesID: [], // 分类ID
        invoiceManner: 0, // 开票方式
        categoriesName: '', // 分类名称
        categoriesInfo: [], // 分类id+name
        payDeadLineDayType: '0', // 客户到款月份 0-当月 1-次月
        payDeadLineDay: '', // 客户到款日期
        isForthwithInvoiceNo: false, // 是否需要反馈
        remarks: '', // 备注
        signingCompanyId: '', // 签单公司编码
        departmentId: '', // 所属部门编码
        regionId: '', // 所属区域
        salesInfo: [],
        description: '', // 描述
        rowversion: '' // 新为空,修改时原值返回
      },
      cooperateStatuseType_arr: [], // 合作状态
      cooperateType_arr: [], // 合作类型
      customerCategory_arr: [], // 客户分类
      customerCharacter_arr: [], // 公司性质
      superCompanyId_arr: [], // 上级公司数组
      costomerCity_arr: [], // 客户所在城市
      serverId_arr: [], // 客服
      signingCompany_arr: [], // 签单公司
      department_arr: [], // 所属部门
      region_arr: [], // 所属区域
      sales_arr: [], // 所属销售
      unitList: [], //申报单位
      days: [{ value: 1, label: '1号' }, { value: 2, label: '2号' }, { value: 3, label: '3号' }, { value: 4, label: '4号' }, { value: 5, label: '5号' }, { value: 6, label: '6号' }, { value: 7, label: '7号' }, { value: 8, label: '8号' }, { value: 9, label: '9号' }, { value: 10, label: '10号' }, { value: 11, label: '11号' }, { value: 12, label: '12号' }, { value: 13, label: '13号' }, { value: 14, label: '14号' }, { value: 15, label: '15号' }, { value: 16, label: '16号' }, { value: 17, label: '17号' }, { value: 18, label: '18号' }, { value: 19, label: '19号' }, { value: 20, label: '20号' }, { value: 21, label: '21号' }, { value: 22, label: '22号' }, { value: 23, label: '23号' }, { value: 24, label: '24号' }, { value: 25, label: '25号' }, { value: 26, label: '26号' }, { value: 27, label: '27号' }, { value: 28, label: '28号' }, { value: 29, label: '29号' }, { value: 30, label: '30号' }, { value: 31, label: '31号' }],
      categoriesList: [],
      invoiceMannerList: [{ value: 0, text: '实发开票' }, { value: 1, text: '应发开票' }],
    }
  },
  created () {
    this.getEnum()
    this.postCompanys()
    this.getSingle()
    this.getProvince()
    this.getUnitList()
    this.getCategoriesList()
    this.serverDown()
    this.getSelectIdListSigningCompany()
    this.getSelectIdListDepartment()
    this.getSelectIdListRegion()
    this.getSelectIdListSales()
  },
  methods: {
    // 添加销售
    addSalePeople () {
      console.log(this.formValidate_t1.salesInfo)
      this.formValidate_t1.salesInfo.push({
        salesId: '',
        salesName: '',
        ratio: ''
      })
    },
    // 删除销售
    delSalePeople (index) {
      this.formValidate_t1.salesInfo.splice(index, 1)
    },
    /**
     * 数据字典
     */
    getEnum () {
      let groupNames = 'customer.type,customer.status,customer.category,customer.character'
      dataApi.getEnum({
        groupName: groupNames
      }).then((res) => {
        this.cooperateType_arr = this.getItems(res.data, 'customer.type')
        this.cooperateStatuseType_arr = this.getItems(res.data, 'customer.status')
        this.customerCategory_arr = this.getItems(res.data, 'customer.category')
        this.customerCharacter_arr = this.getItems(res.data, 'customer.character')
      })
      // Common.getEnum(groupName, this.arrListDown)
    },
    getItems (arr, key) {
      let object = arr.find((item) => {
        return item.group === key
      })
      return object.items
    },
    // 获取上级公司
    postCompanys () {
      dataApi.postCompanys({
        PageIndex: 1,
        PageSize: 10000
      }).then((res) => {
        // console.log(res)
        this.superCompanyId_arr = res.data[0].items
      })
    },
    // 获取客户基本信息
    getSingle () {
      this.spinShow = true
      dataApi.getSingle({
        id: this.customerId
      }).then(res => {
        console.log(res)
        console.log('%c this.formValidate_t1: ', 'color:red', res.data.data)
        if (res.data.data) {
          this.formValidate_t1 = res.data.data
          if (this.formValidate_t1.areaPath) {
            this.costomerCity_arr = this.formValidate_t1.areaPath.split(',')
          }
          if (!this.formValidate_t1.salesInfo) {
            this.formValidate_t1.salesInfo = []
          }
          if (res.data.data.type === 3) {
            this.isSpiltDisabel = true
          }
          if (res.data.data.type === 1) {
            // this.isAgency = false
          }
          this.formValidate_t1.payDeadLineDayType = res.data.data.payDeadLineDayType + ''
          this.formValidate_t1.categoriesID = res.data.data.categoriesInfo ? res.data.data.categoriesInfo.map(item => {
            return item.categoriesID
          }) : []
          this.spinShow = false
        } else {
          this.spinShow = false
        }
      })
    },
    // 上级公司选择
    superCompanyIdChange (val) {
      if (val) {
        this.formValidate_t1.superCompanyName = val.label
      }
    },
    // 客户分类选择
    categoryChange (val) {
      if (val) {
        this.formValidate_t1.categoryName = val.label
      }
    },
    // 公司性质选择
    characterChange (val) {
      if (val) {
        this.formValidate_t1.characterName = val.label
      }
    },
    // 分类选择
    categoriesChange (val) {
      // console.log('分类选择 val: ', val)
      // this.formValidate_t1.categoriesName = val ? val.label : null
      this.formValidate_t1.categoriesInfo = val.map(item => {
        return {categoriesID: item.value, categoriesName: item.label}
      })
      console.log('分类选择 this.formValidate_t1.categoriesInfo: ', this.formValidate_t1.categoriesInfo)
    },
    // 客户所在城市选择
    costomerCityChange (value, selectedData) {
      console.log(value, selectedData)
      this.formValidate_t1.areaPath = value.join(',')
      this.formValidate_t1.cityId = value[value.length - 1]
      this.formValidate_t1.cityName = selectedData[selectedData.length - 1].label
    },
    // 所属客服选择
    addServerIdChange (val) {
      if (val) {
        this.formValidate_t1.serverName = val.label
      } else {
        this.formValidate_t1.serverName = ''
      }
    },

    salesChange (val) {
      console.log(val)
      if (val) {
        this.formValidate_t1.salesInfo[val.tag].salesName = val.label
      } else {
        // this.formValidate.serverName = ''
        this.formValidate_t1.salesInfo = [{
          salesId: '',
          salesName: '',
          ratio: ''
        }]
      }
    },
    /**
     * server所属客服下拉数据
     */
    serverDown () {
      let data = {
        pageIndex: 1,
        pageSize: 1000
      }
      dataApi.postServers(data).then(res => {
        this.serverId_arr = res.data[0].items
      })
    },
    // 对应下拉数据  20210107
    getSelectIdListSigningCompany () {
      dataApi.GetSelectIdList({
        type: 'SigningCompany'
      }).then(res => {
        console.log(res.data.data)
        this.signingCompany_arr = res.data.data
      })
    }, 
    getSelectIdListDepartment () {
      dataApi.GetSelectIdList({
        type: 'Department'
      }).then(res => {
        console.log(res.data.data)
        this.department_arr = res.data.data
      })
    }, 
    getSelectIdListRegion () {
      dataApi.GetSelectIdList({
        type: 'Region'
      }).then(res => {
        console.log(res.data.data)
        this.region_arr = res.data.data
      })
    }, 
    getSelectIdListSales () {
      dataApi.GetSelectIdList({
        type: 'Sales'
      }).then(res => {
        console.log(res.data.data)
        this.sales_arr = res.data.data
      })
    }, 
    /**
     * 查询所有省
     */
    getProvince () {
      dataApi.getProvince().then(res => {
        this.areaArr = res.data.data.map(item => {
          return {
            ...item,
            label: item.name,
            value: item.id,
            children: [],
            loading: false
          }
        })
      })
    },
    loadDataCity (val, callback) {
      val.loading = true
      if (val.levelID === 2) {
        dataApi.getCity({ parentId: val.value }).then(res => {
          val.children = res.data.data.map(item => {
            return {
              ...item,
              label: item.name,
              value: item.id,
              children: []
              // loading: false
            }
          })
          val.loading = false
          callback()
        })
      } else {
      }
    },
    // 获取申报单位下拉
    getUnitList () {
      // console.log(this.$store.state.user.companyID)
      dataApi.getUnitList({
        id: this.$store.state.user.companyID
      }).then(res => {
        this.unitList = res.data.data
        // let arr = this.unitList.find(item => {
        //   return item.isDefault
        // })
        // this.unitId = arr.id
        // this.formValidate.declareUnitId = this.unitId
      })
    },
    // 获取分类下拉
    getCategoriesList () {
      dataApi.GetSelectIdList({type: 'Categories'}).then(res => {
        this.categoriesList = res.data.data
      })
    },
    // 修改
    reviseBtn () {
      this.isCheck = false
    },
    // 保存第一步-基本信息
    saveStep_1 () {
      console.log('this.formValidate_t1: ', this.formValidate_t1)
      dataApi.postCustomer(this.formValidate_t1).then((res) => {
        if (res.data.code === 200) {
          this.$Message.success(res.data.message)
          this.isCheck = true
          this.formValidate_t1.rowVersion = res.data.data.rowversion
        } else {
          
          this.$Message.error({
            content: res.data.message,
            duration: 10,
            closable: true
          })
        }
      })
    }
  }
}
</script>

<style lang="less">
.customer-switch{
  &.ivu-switch-disabled{
    opacity: 1;
  }
}
</style>
